//
//  ExamineModel.m
//  YuTang
//
//  Created by 葛悦彣 on 2024/8/23.
//

#import "ExamineModel.h"
#import "CombinedPunchModel.h"

@implementation ExamineModel
+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"ID":@[@"id"],
    };
}
+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{
        @"pondTissues":[CombinedPunchTissueListModel class],
    };
}

- (NSString *)tissueListStr{
    if(!_tissueListStr){
        NSMutableArray <NSString *>* strArray = [NSMutableArray array];
        for (CombinedPunchTissueListModel * model in self.pondTissues) {
            NSString * str = [NSString stringWithFormat:@"%@ %@",model.pondTissue,model.pondName];
            [strArray addObject:str];
        }
        _tissueListStr = [strArray componentsJoinedByString:@"\n"];
    }
    return _tissueListStr;
}

- (CGFloat)tissueListStrH{
    CGFloat textH = [DTKTool textWithtitle:self.tissueListStr andSize:CGSizeMake(kwt(350), 10000) andFout:kCFont(16)].height;
    if(textH < kwt(16)){
        return kwt(16);
    }
    return textH;
}
-(CGFloat)pondNameH{
    if(_pondNameH == 0){
        _pondNameH = [DTKTool textWithtitle:[NSString stringWithFormat:@"%@ %@",self.pondTissue,self.pondName] andSize:CGSizeMake(kwt(351), 10000) andFout:kCFont(16)].height;
        if(_pondNameH < kwt(16)){
            _pondNameH = kwt(16);
        }
    }
    return _pondNameH;
}

- (CGFloat)cellH{
    if(_cellH == 0){
        if(self.applyType == 1){///取消
//            _cellH = kwt(43 + 34 + 66 + 20) + self.tissueListStrH;
            _cellH = kwt(43 + 34 + 66 + 20) + kwt(16);

        } else {
//            _cellH = kwt(43 + 34 + 93 + 20) + self.tissueListStrH;
            _cellH = kwt(43 + 34 + 93 + 20) + kwt(16);

        }
    }
    return _cellH;
}

@end
@implementation AuditCountModel
@end
